<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      xmlns:security="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript"
            th:src="@{/static/js/jquery-3.3.1.js}"></script>
    <title>Title</title>
</head>
<body>
helloJsp
<input type="button" id="logout" value="退出登录" />
<div shiro:hasPermission="user:add">
    <button id="add" name="add">添加</button>
</div>
</body>
<script type="text/javascript">

    var urlPath = [[@{/}]];

    $("#logout").click(function(){
        location.href = urlPath + "/logout";
    });
</script>
</html>